<?php
/**
 * Created by PhpStorm.
 * User: River
 * Email: river0428@gmail.com
 * Date: 2018/12/12
 * Time: 下午1:12
 */

namespace Modules\Api\Controllers;


use App\Models\Feedback;
use App\Models\User;
use Illuminate\Http\Request;
use Modules\Token\Facades\Token;

class FeedbackController extends Controller
{
    public function store(Request $request)
    {
        $uid  = Token::data('id');
        $user = User::find($uid);

        $title = $request->input('title');
        $content = $request->input('content');
        $images = $request->input('images');

        $feedback = new Feedback();
        $feedback->title = $title;
        $feedback->content = $content;
        $feedback->images = $images;
        $feedback->user_id = $user->id;
        $feedback->save();

        return success();
    }
}